<?php

abstract class a_admin_controller extends a_base_controller {

    public function __construct($post_handling_enabled=FALSE) {
        parent::__construct($post_handling_enabled);
        $this->add_global_var("ui_tab_index", $this->input->post('ui_tab_index'));
        $this->set_theme("admin");
        if ($this->ci()->current_controller !== 'sys_login') {
            if (!is_sys_user_logged_in ()) {
                //@TO_DO : this redirect url should come from a global setting
                redirect("user/admin/sys_login");
            }
        }
    }

    protected function set_ui_tab_index($index) {
        set_cookie("ui_tab_index",$index,0);
        //$this->assign("ui_tab_index", $index);
    }

    protected function is_system_user() {
        $user = get_logged_user();
        if ($user) {
            if ($user->is_system_user === "1") {
                return TRUE;
            } else {
                return FALSE;
            }
        }
    }

    public function is_usper_user() {
        
    }

}

?>